home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / mindos11.zip / MSHNAME.C < prev   
C/C++ Source or Header  |  1991-03-22  |  882b  |  37 lines

  1. /*  mshname.c   -- show only name of a regular Minix file */
  2. /*  Copyright 1988,1991 Steven W. Harrold - All rights reserved. */
  3. /*  $Header: MSHNAME.C_V 1.2 91/03/19 09:58:22 SWH Exp $ */
  4.  
  5. #include    <stdio.h>
  6. #include    "mfs.h"
  7.  
  8.  
  9. /*==================================================================*/
  10. void show_name (path, dp, iarea)
  11. char                *path ;
  12. struct directory    *dp ;
  13. struct inode        *iarea ;
  14. {
  15.     int         i, j, k, n ;
  16.     char        c ;
  17.  
  18.     if (!(n = dp->d_inum)) /*assignok*/
  19.         return ;
  20.     if (!(iarea[n].i_mode & I_REGULAR))
  21.         return ;
  22.  
  23.     printf ("%s", path) ;
  24.     if (path[1])
  25.         printf ("/") ;
  26.  
  27. /*  Display the unadorned filename
  28.  */
  29.     for (i=0; (i<NAME_SIZE) && (c=dp->d_name[i]); i++) /*assignok*/
  30.         printf ("%c", c) ;
  31.     printf ("\n") ;
  32.  
  33. } /* show_name() */
  34.  
  35.  
  36. /*---eof---*/
  37.